package org.btik.light.tool.type;

import java.nio.charset.StandardCharsets;

/**
 * @author lustre
 * @since 2023/9/21 0:51
 */
public class HashByteArrayFactory {
    public static final HashByteArray EMPTY = new HashByteArray(new byte[0]);

    public static HashByteArray strAsBArray(String str){
        return new HashByteArray(str.getBytes(StandardCharsets.UTF_8));
    }

    public static void copy(HashByteArray src, byte[] dest, int srcPos, int destPos, int length){
        System.arraycopy(src.value, srcPos, dest, destPos, length);
    }
}
